package com.jacky.model;

import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;

import java.beans.PropertyDescriptor;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: jacky
 * @date: 2018/10/31
 * Time: 15:23
 * Description:
 **/
public class User implements BeanPostProcessor {


    private int id;
    private String userName;

    public User() {
        System.out.println("-------------调用user构造方法--------------------");
    }



    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("----------------------postProcessBeforeInitialization---------------------------");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("----------------------postProcessAfterInitialization---------------------------");
        return bean;
    }
}